package com.jike.jkgame;

import android.app.Application;
import android.widget.Toast;

public class JKApp extends Application {
	
	private static JKApp mTheApp;
	private static boolean mIsLogin = false;
	private Toast mToast;
	
	public static JKApp get() {
		return mTheApp;
	}

	public JKApp() {
		super();
		mTheApp = JKApp.this; 
	}

	@Override
	public void onCreate() {
		super.onCreate();
		
	}
	
	public void setLogin(boolean loggedin) {
		mIsLogin =  loggedin;
	}
	
	public boolean isLoggedin() {
		return mIsLogin;
	}
	
	public void showToast(String message) {
	    if (mToast == null) {
	        mToast = Toast.makeText(get(), message, Toast.LENGTH_SHORT);
	    }
	    
	    mToast.setText(message);
	    mToast.show();
	}
	
	public void showToast(int resId) {
        if (mToast == null) {
            mToast = Toast.makeText(get(), "", Toast.LENGTH_SHORT);
        }
        
        mToast.setText(resId);
        mToast.show();
    }

}
